package c.e.b.h.e;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.util.Log;
import c.e.b.h.e.k.g;
import c.e.b.h.e.k.l0;
import c.e.b.h.e.k.n0;
import c.e.b.h.e.k.q0;
import c.e.b.h.e.n.c;
import c.e.b.h.e.s.d;
import c.e.b.h.e.s.i.a;
import c.e.b.h.e.s.i.b;
import c.e.b.h.e.s.j.e;
import java.util.Objects;
import java.util.concurrent.Executor;

/* compiled from: Onboarding */
public class h {
    public final c a = new c();
    public final c.e.b.c b;
    public final Context c;
    public PackageManager d;
    public String e;
    public PackageInfo f;
    public String g;
    public String h;
    public String i;
    public String j;
    public String k;
    public q0 l;
    public l0 m;

    public h(c.e.b.c cVar, Context context, q0 q0Var, l0 l0Var) {
        this.b = cVar;
        this.c = context;
        this.l = q0Var;
        this.m = l0Var;
    }

    public static void a(h hVar, b bVar, String str, d dVar, Executor executor, boolean z) {
        Objects.requireNonNull(hVar);
        b bVar2 = b.a;
        c.e.b.h.e.s.c cVar = c.e.b.h.e.s.c.SKIP_CACHE_LOOKUP;
        String str2 = "17.2.2";
        if ("new".equals(bVar.a)) {
            if (new c.e.b.h.e.s.j.b(hVar.c(), bVar.b, hVar.a, str2).d(hVar.b(bVar.e, str), z)) {
                dVar.d(cVar, executor);
                return;
            } else if (bVar2.a(6)) {
                Log.e("FirebaseCrashlytics", "Failed to create app with Crashlytics service.", null);
                return;
            } else {
                return;
            }
        }
        if ("configured".equals(bVar.a)) {
            dVar.d(cVar, executor);
        } else if (bVar.f) {
            bVar2.b("Server says an update is required - forcing a full App update.");
            new e(hVar.c(), bVar.b, hVar.a, str2).d(hVar.b(bVar.e, str), z);
        }
    }

    public final a b(String str, String str2) {
        return new a(str, str2, this.l.c, this.h, this.g, g.e(g.k(this.c), str2, this.h, this.g), this.j, n0.a(this.i).a, this.k, "0");
    }

    public String c() {
        Context context = this.c;
        int m = g.m(context, "com.crashlytics.ApiEndpoint", "string");
        return m > 0 ? context.getString(m) : "";
    }
}
